<?php
namespace Admin\Controller;
use Think\Controller;
class PowerController extends BaseController{
	function power(){
		$AdminOb=M('Auth_group');
		$arr=$AdminOb->select();
		$typeOb=M('Auth_rule');
		$Type=$typeOb->select();
		$this->assign('Type',$Type);
		$this->assign('arr',$arr);
		$this->display();
	}
	function check(){
		$_POST['rules']=substr($_POST['rules'],0,strlen($_POST['rules'])-1);
		$AdminOb=M('Auth_group');
		$arr=$AdminOb->data($_POST)->add();
		if ($arr) {
			echo 1;
		}else{
			$this->ajaxReturn('0');
		}
	}
}